package com.swlz.service.impl;

import java.sql.SQLException;
import java.util.List;

import com.swlz.dao.RoleDAO;
import com.swlz.entity.Role;
import com.swlz.service.RoleService;

/**<pre>
 * - 
 * ClassName : com.swlz.service.impl.RoleServiceImpl
 * Author : swlz
 * E-Mail : 2233875735@qq.com
 * Date : 2020年7月29日 下午4:35:07
 * Version : 1.0
 * Copyright 2020 swlz.top Inc. All rights reserved. 
 * Warning: this content is only for internal circulation of the company. 
 * It is forbidden to divulge it or use it for other commercial purposes.
 * </pre>
 **/
public class RoleServiceImpl implements RoleService {
	
	private RoleDAO roleDAO = new RoleDAO();

	@Override
	public Role get(Integer roleId) {
		try {
			return roleDAO.selectById(roleId);
		} catch (SQLException e) {
			e.printStackTrace();//
			throw new RuntimeException("获取角色失败", e);
		}
	}

	@Override
	public List<Role> list() {
		try {
			return roleDAO.selectByModel(null, 0, 99);
		} catch (SQLException e) {
			e.printStackTrace();//
			throw new RuntimeException("获取角色列表失败", e);
		}
	}

}
